<?php
$this->_var['smenupagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.js";
$this->_var['smenupagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.bgiframe.js";
$this->_var['smenupagejs'][] = $this->_var['TMPL_REAL']."/js/jquery.weebox.js";
$this->_var['smenupagejs'][] = $this->_var['TMPL_REAL']."/js/lazyload.js";
$this->_var['smenupagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";
$this->_var['smenucpagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";
$this->_var['smenucss'][] = $this->_var['TMPL_REAL']."/css/style.css";
$this->_var['smenucss'][] = $this->_var['TMPL_REAL']."/css/weebox.css";
$this->_var['smenucss'][] = $this->_var['TMPL_REAL']."/css/smenu.css";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<title>{$store_info.name} - 发送选菜单</title>
	<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$smenucss"}" />
	<script type="text/javascript" src="{$APP_ROOT}/public/runtime/app/lang.js"></script>
	<script type="text/javascript" src="{function name="parse_script" v="$smenupagejs" c="$smenucpagejs"}"></script>
</head>
<script type="text/javascript">
var APP_ROOT = '{$APP_ROOT}';
var CART_URL = '{url x="shop" r="cart"}';
var CART_CHECK_URL = '{url x="shop" r="cart#check"}';
var LOADER_IMG = '{$TMPL}/images/lazy_loading.gif';
var ERROR_IMG = '{$TMPL}/images/image_err.gif';
</script>
<body>  
    <div class="od_sms_x auto mt20">
        <form method="post" action="{url x="store" r="smenu#send"}" id="formSms">
	    <div class="od_sms_tit">免费发送到手机</div>
        <div class="p10">
    	    <div class="pt5 pl20 pb10">
        	    <strong class="f14">我选的菜（{$store_info.name}） - </strong><span class="g9">发送短信</span>
            </div>
            <div class="p5 btc1">
        	    <div class="p10 g6">以下内容通过手机短信的形式，发送到您指定的手机：</div>
                <div class="od_sms_con_x">{$store_info.name}：{foreach from=$list key=key item="item"}{if $key neq 0}，{/if}{$item.name}{/foreach}</div>
                <div class="p10">
                    
            	    <div class="b mt5 pb5">请输入手机号：</div>
                    <input type="text" class="ginput w147" name="mobile" id="mobile" value="">
                    <div class="b mt10 pb5">为了防止恶意短信发送，请填写验证码确认：</div>                    
                    <input type="text" class="ginput w147" name="code" id="code">
                    <img class="vm" id="tempImg" alt="看不清楚?点击刷新" align="top" border="0"  onclick="this.src='{$APP_ROOT}/verify.php?vname=smenu_sms_verify&rand='+ Math.random();" src="{$APP_ROOT}/verify.php?vname=smenu_sms_verify&rand={function name="rand"}">
                    <div class="mt10 pt5">
                	    <span class="odsd_btn"><a href="javascript:void(0);" onclick="return PostSms();" class="odsd_btn_in w48 tc">发送</a></span>
                    </div>
                    <!-- 提示 -->
                    <ul class="g9 lh18 pt20 fs">
                	    <li>* 如果看不清验证码，请点击图片刷新。</li>
                        <li>* 短信可能有3-5分钟的延时，请不要在短时间内多次重复下载。</li>
                        <li>* 短信内容过长，可能会分多条发送。</li>
                        <li>* 您的手机号码仅用于发送您需要的商户信息，不会透露给第三方。</li>
                    </ul>
                </div>
            </div>
        </div>
		<input type="hidden" id="sid" name="sid" value="{$sid}" />
		<input type="hidden" id="mid" name="mid" value="{$mid}" />
        </form>
    </div>
	<script type="text/javascript">
		function PostSms(){
			jQuery(function(){
				if($.trim($("#mobile").val())==""){
					$.showErr("请输入手机号码!");
					return false;
				}
				if(!$.checkMobilePhone($("#mobile").val())){
					$.showErr("手机号码有误!");
					return false;
				}
				
				if($.trim($("#code").val())==""){
					$.showErr("请输入验证码!");
					return false;
				}
				url = $("#formSms").attr("action");
				var query = $("#formSms").serialize();
				
				$.ajax({
					url:url,
					data:query,
					type:"post",
					cache:false,
					dataType:"json",
					success:function(result){
						if(result.status==0){
							$.showErr(result.message);
							return false;
						}
						else{
							$.showSuccess("发送成功！",function(){
								window.close();
							});
						}
					}
				});
			});
		}
	</script>
</body>
</html>
